/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#include "PacketFactoryManager.h"

namespace PQNet
{
	PacketFactoryManager::PacketFactoryManager()
	{
	}

	void PacketFactoryManager::init()
	{
		//add factories
	}

	void PacketFactoryManager::addFactory(PacketFactory* factory)
	{
		int id=factory->getPacketId();
		if(id<0&&id>=Packet_Type_Count){
			//index out range
			return;
		}
		if(_factories[id]!=NULL ) {
			//repeat set
			return;
		}
		_factories[id]=factory;

	}

}
